package cn.kpi.service.sys.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.kpi.dao.sys.GeneralCodeDao;
import cn.kpi.entity.sys.GeneralCodeEntity;
import cn.kpi.service.sys.IGeneralCodeService;

@Service
public class GeneralCodeServiceImpl implements  IGeneralCodeService{
	
	@Autowired
	private GeneralCodeDao generalCodeDao;
	
	public int InsertEntity(GeneralCodeEntity entity) throws Exception{
		try{
			return generalCodeDao.InsertEntity(entity);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
	public List<GeneralCodeEntity> GetGeneralCodeList()throws Exception{
		try{
			return generalCodeDao.GetGeneralCodeList();
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public GeneralCodeEntity GetGeneralCodeById(Long generalid)throws Exception{
		try{
			return generalCodeDao.GetGeneralCodeById(generalid);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public int DeleteEntity(Long generalid)throws Exception{
		try{
			return generalCodeDao.DeleteEntity(generalid);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
	public int UpdateEntity(GeneralCodeEntity entity)throws Exception{
		try{
			return generalCodeDao.UpdateEntity(entity);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
	public List<GeneralCodeEntity> GetGeneralCodeListByWhere(String where)throws Exception{
		try{
			return generalCodeDao.GetGeneralCodeListByWhere(where);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public List<GeneralCodeEntity> GetGeneralCodeListLimit(int beginrow,int endrow)throws Exception{
		try{
			return generalCodeDao.GetGeneralCodeListLimit(beginrow,endrow);
		}
		catch(Exception ex){
			ex.printStackTrace();
			return null;
		}
	}
	public int GetGeneralCodeListLimitCount()throws Exception{
		try{
			return generalCodeDao.GetGeneralCodeListLimitCount();
		}
		catch(Exception ex){
			ex.printStackTrace();
			return -1;
		}
	}
}
